package com.yanqu.road.entity.activity.chefduel;


import java.math.BigInteger;
import java.util.Comparator;
import java.util.List;

//阶段1成品食材比赛
public class ChefDuelMatchRank {

	private long serverId;

	private long userId;

	private BigInteger value;//积分

	private long foodCookTime;//第一名的菜烹饪时间

    private List<ChefDuelMatchDish> matchDishList;//这个玩家自己的菜

    private long lastUpdateTime;

    public long getServerId() {
        return serverId;
    }

    public void setServerId(long serverId) {
        this.serverId = serverId;
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    public BigInteger getValue() {
        return value;
    }

    public void setValue(BigInteger value) {
        this.value = value;
    }

    public long getFoodCookTime() {
        return foodCookTime;
    }

    public void setFoodCookTime(long foodCookTime) {
        this.foodCookTime = foodCookTime;
    }

    public List<ChefDuelMatchDish> getMatchDishList() {
        return matchDishList;
    }

    public void setMatchDishList(List<ChefDuelMatchDish> matchDishList) {
        this.matchDishList = matchDishList;
    }

    public long getLastUpdateTime() {
        return lastUpdateTime;
    }

    public void setLastUpdateTime(long lastUpdateTime) {
        this.lastUpdateTime = lastUpdateTime;
    }

    public void dishSort(){
        matchDishList.sort(new dishSort());
    }

    //从大到小
    static class dishSort implements Comparator<ChefDuelMatchDish> {
        @Override
        public int compare(ChefDuelMatchDish o1, ChefDuelMatchDish o2) {
            if (o1.getFraction() == o2.getFraction()) {
                return 0;
            }
            if (o1.getFraction() <= o2.getFraction()) {
                return 1;
            }
            return -1;
        }
    }
}
